package de.jonasblatt.networkapi.rpi.network.commands.client;

import de.jonasblatt.networkapi.rpi.model.RpiWorker;
import de.jonasblatt.networkapi.rpi.network.commands.ClientCommand;
import de.jonasblatt.networkapi.rpi.network.commands.server.SCSendSystemVal;
import de.jonasblatt.networkapi.rpi.network.server.Server;

public class CCRequestSystemVal implements ClientCommand {

	private int clientId;
	private int times;
	private String val;
	private long wait;

	public CCRequestSystemVal(int clientId, String val) {
		this.clientId = clientId;
		this.val = val;
	}

	@Override
	public void execute(Server server) {
		RpiWorker rpiWorker = (RpiWorker) server.getModel();
		server.updateClient(this.clientId, new SCSendSystemVal(this.val,
				rpiWorker.getSystemVal(this.val)));
	}
}
